#ifndef OPTIMIZE__H
#define OPTIMIZE__H

#include "../util/structure.h"

typedef bool (*merge_func)(MAP,MAP);
typedef void (*statement_func)(MAP,operation *);
typedef bool (* optimize_func)(MAP,operation *);
typedef MAP (* boundary_func)(List);
//const folder
bool const_merge(MAP,MAP);
void const_statement(MAP,operation *);
bool const_optimize(MAP,operation *);
MAP const_boundary_init(List);
//common exp
bool common_merge(MAP,MAP);
void common_statement(MAP, operation *);
bool common_optimize(MAP,operation *);
MAP common_boundary_init(List);
//copy-prograion
bool copy_merge(MAP,MAP);
void copy_statement(MAP,operation *);
bool copy_optimize(MAP,operation *);
MAP copy_boundary_init();
//active-analysis
extern bool active_done;
bool active_merge(MAP,MAP);
void active_statement(MAP,operation *);
bool active_optimize(MAP,operation *);
bool active_opt2state(MAP,operation *,operation *);
MAP active_boundary_init();
#endif
